package com.sg.service.impl;

import com.sg.bean.Food;
import com.sg.dao.FoodDao;
import com.sg.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangcf
 * @Description 外卖地址业务逻辑接口实现
 * @date 2023/3/14 10:19
 */
@Service
public class FoodServiceImpl implements FoodService {

    @Autowired
    private FoodDao foodDao;

    @Override
    public List<Food> findByUId(int uId) {
        return foodDao.findByUId(uId);
    }

    @Override
    public Food findByFoodId(int foodId) {
        return foodDao.findByFoodId(foodId);
    }

    @Override
    public boolean add(Food food) {
        return foodDao.add(food) > 0 ? true : false;
    }

    @Override
    public boolean delete(int foodId) {
        return foodDao.delete(foodId) > 0 ? true : false;
    }

    @Override
    public boolean update(Food food) {
        return foodDao.update(food) > 0 ? true : false;
    }
}
